
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <c:if test="${requestScope.pageBean==null }">
    	 <jsp:forward page="AdminChapterServlet" />
    </c:if>
    
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>user</title>
</head>
<script src="assets/jquery/jquery-3.7.1.js" type="text/javascript" charset="utf-8" ></script>
<style>
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    min-width: 400px;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  }
  th, td {
    padding: 12px 15px;
    text-align: center;

    border-bottom: 1px solid #dddddd;
  }
  th {
    font-size: 20px;
    background-color: #009879;
    color: #ffffff;
    text-align: center;
  }
  tr {
    background-color: #f3f3f3;
  }
  tr:nth-of-type(even) {
    background-color: #dddddd;
  }
  button {
  background-color: #4CAF50; /* 按钮颜色 */
  border: none;
  color: white; /* 文字颜色 */
  padding: 9px 20px; /* 内边距 */
  text-align: center; /* 文字居中 */
  text-decoration: none;
  display: inline-block;
  font-size: 16px; /* 字体大小 */
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 16px; /* 圆角边框 */
  transition: background-color 0.3s; /* 过渡效果 */
}
 
button:hover {
  background-color: green; /* 鼠标悬浮颜色 */
}
a{
	text-decoration: none;
	color :white;
}
#delete_button{
	background-color: red;
}
th{
	background-color: black;
}
h2 a{
	color:black;
	border:0.5px solid grey;
	border-radius: 3px;
	 transition: background-color 0.3s; /* 过渡效果 */
}
h2 a:hover{
		background-color: black;
		color:white;
}
#delete_button:hover{
	background-color: #CC0000;
}
</style>
<body>
  <table id="myTable">
  <tr>
    <th>章节ID</th>
    <th>章节名字</th>
    <th>所属小说Id</th>
    <th>章节更新时间</th>
    
    <th>章节内容</th>
 
    <th>修改</th>
    <th>删除</th>
  </tr>
		<c:forEach items="${pageBean.date }" var="chapter">
			<tr>
				<td>${chapter.chapterId }</td>
				<td>${chapter.chapterName }</td>
				<td>${chapter.novelId }</td>
				
				<td>
					<textarea name="readonly" rows="4" cols="50" readonly style="background-color:#ccc">
					${chapter.chapterContent}
					</textarea>
				</td>
				<td>${chapter.updateTime }</td>
				
				<td><button><a href="chapterUpdate.jsp?chapterId=${chapter.chapterId }&chapterName=${chapter.chapterName }&chapterContent=${chapter.chapterContent}&updateTime=${chapter.updateTime }">修改</a></button></td>
				<td><button id="delete_button"><a href="chapterDeleteServlet?chapterId=${chapter.chapterId }">删除</a></button></td>
			</tr>
		</c:forEach>
</table>
	<h2>
		<c:if test="${pageBean.nowPage>1 }" var="result1" scope="request">
			<a href="AdminChapterServlet?nowPage=1">首页</a>
			<a href="AdminChapterServlet?nowPage=${pageBean.nowPage-1 }">上一页</a>
		</c:if>
		<c:if test="${pageBean.nowPage<pageBean.pageNumEnd }" var="result2" scope="request">
		<a href="AdminChapterServlet?nowPage=${pageBean.nowPage+1 }">下一页</a>
			<a href="AdminChapterServlet?nowPage=${pageBean.pageNumEnd }">尾页</a>
		</c:if>
	</h2>
</body>
<script>
  
</script>

</html>